package cn.tedu.v1.mapper;

import cn.tedu.v1.model.PrescriptionSum;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
* <p>
    *  Mapper 接口
    * </p>
*
* @author tedu.cn
* @since 2021-07-07
*/
    @Repository
    public interface PrescriptionSumMapper extends BaseMapper<PrescriptionSum> {

    @Insert("insert into prescription_sum values(null,#{drug},#{count},#{info})")
    @Options(useGeneratedKeys = true,keyProperty = "recordId")
    void submitPrescription(PrescriptionSum prescriptionSum);

    @Select("select * from prescription_sum where id between #{start} and #{end}")
    List<PrescriptionSum> selectBetween(Integer start, Integer end);
}
